import 'package:flutter/material.dart';

class MyScaffold extends StatefulWidget {
  @override
  _MyScaffoldState createState() => _MyScaffoldState();
}

class _MyScaffoldState extends State<MyScaffold> {
  int _currentIndex = 0;
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("示例"),
          centerTitle: true,
        ),
        bottomNavigationBar: BottomNavigationBar(
          items: [
            BottomNavigationBarItem(icon: Icon(Icons.home),title: Text("首页")),
            BottomNavigationBarItem(icon: Icon(Icons.bookmark),title: Text("记录")),
            BottomNavigationBarItem(icon: Icon(Icons.account_circle),title: Text("用户"))
          ],
          currentIndex: _currentIndex,
          onTap: (index){
            setState(() {
              _currentIndex = index;
            });
          },
        ),
        drawer: Drawer(
          child: Container(
            color: Colors.red,
          ),
        ),
        endDrawer: Drawer(
          child: Container(
            color: Colors.yellow,
          ),
        ),
        floatingActionButton: FloatingActionButton(
          child: Text("+",style: TextStyle(fontSize: 30),),
          onPressed: (){},
        ),
      ),
    );
  }
}
